// 时间戳转换函数

const getLocalTime = (time) => {
  let date = new Date(time);
  //时间戳为10位需*1000，时间戳为13位的话不需乘1000
  let y = date.getFullYear();
  let M = date.getMonth() + 1;
  M = M < 10 ? "0" + M : M; //月补0
  let d = date.getDate();
  d = d < 10 ? "0" + d : d; //天补0
  // let h = date.getHours();
  // h = h < 10 ? "0" + h : h; //小时补0
  // let m = date.getMinutes();
  // m = m < 10 ? "0" + m : m; //分钟补0
  // let s = date.getSeconds();
  // s = s < 10 ? "0" + s : s; //秒补0
  // return y + "-" + M + "-" + d + " " + h + ":" + m + ":" + s;
  return y + "-" + M + "-" + d;
};
export default getLocalTime;
